<div class="wrapper-form">
	<?php echo $this->Form->create('Image', array('id' => 'ImageForm', 'type' => 'file')); ?>
	<table class="form-table">
			<tr>
				<td class='l-style'><?php echo __('Variant') ?></td>
				<td class="r-style width_middle"><?php echo $this->Form->Input('owner_id', array('label' => false)) ?></td>
			</tr>
			<tr>
				<td class='l-style'><?php echo __('Image') ?></td>
				<td class="r-style width_middle">
					<?php echo $this->Form->Input('photo', array('label' => false, 'type' => 'file', 'class' => 'required'));
								echo $this->Form->hidden('dir');
								echo $this->Form->hidden('mimetype');
								echo $this->Form->hidden('filesize'); ?>
				</td>
			</tr>
		<tr>
			<td class='l-style no-border no-background'>
				(<span class='red-star'>*</span>) <?php echo __('Required') ?>
			</td>
			<td class='r-style actions no-border no-background'>
				<?php echo __($this->Form->submit(__('Save'), array('id' => 'submit_image'))); ?>
			</td>
		</tr>
	</table>
	<?php echo $this->Form->end(); ?>
</div>
<script type="text/javascript">
	jQuery(document).ready(function(){
		jQuery("#ImageForm").validate();
	});
</script>

<table cellpadding="0" cellspacing="0" class="table-listing">
	<tr>
			<th><?php echo __('Image') ?></th>
			<th><?php echo __('Variant') ?></th>
			<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
	foreach ($images as $image): ?>
	<tr class="tr-row">
		<td class="canclick post-img-small"><?php echo $this->Images->showSmall($image['Image']) ?></td>
		<td class="canclick"><?php echo $image['Variant']['name'] ?></td>
		<td class="actions action-cm3">
			<?php echo $this->Form->postLink(__('Delete'), array('admin' => true, 'action' => 'deleteImage', $id, $image['Image']['id']), array('class' => 'act-lk del-link'), __('Are you sure you want to delete # %s?', $image['Image']['id'])); ?>
		</td>
	</tr>
	<?php endforeach; ?>
</table>
